<?php

defined('BASEPATH') OR exit('No direct script access allowed');

	class Tester extends CI_Controller {

		public function index()
		{
			$this->load->library('unit_test');
			//Test 1
			// $test = 1 + 1;
			// $expected_result = 2;
			// $test_name = 'Adds one plus one';
			// $this->unit->run($test, $expected_result, $test_name);   

			//Test 2
			// $a=array();
			// $this->unit->run(sizeof($a), 0, 'Empty array');    
			
			echo $this->unit->report();
		}
	}

/*
class Landing extends Controller
{
	public function Landing(){
		parent::Controller();
	}

	//TESTING GENERAL
	public function index()
	{
		$data['title'] = 'CI DEMO';

		$this->load->library('unit_test');
		$this->unit->run($data, array('title'=>'CI DEMO'), 'title');
		$this->unit->run(1, 2, 'error');

		$this->getData();

		$data['testing'] = $this->unit->report();

		$this->load->view('landing/index', $data);

	}

	//TESTING MODELS
	private function getData()
	{
		$this->load->model('demo');
		$result = $this->demo->getList();
		$expectedFormat = '<h1>CodeIgniter Demo</h1>';
		$this->unit->run($this->demo->format($result[0]),$expectedFormat, 'MODEL FORMATTING');

	}

}
?>



class test extends Controller {

    function test()
    {
        parent::Controller();
        $this->load->library('unit_test');
    }

    function index()
    {
        $this->all();
    }
    function all() {
        $this->test1();
        $this->test_n();
        // ... as needed ...
    }
    
    function test1() {
        //performs test...
        $this->unit->run( $var_result, 1, 'test 1, etc, etc' );
        //performs test...
        $this->unit->run( $var_result, 2, 'test 2, etc, etc' );
        //performs test...
        $this->unit->run( $var_result, 2, 'test 2, etc, etc' );
        
        echo $this->unit->report();
    }
    
    function test_n() {
        // ...
    }
    
    // ... more tests ...
} 

*/
?>
